const moment = require('moment')

const Timer = {
  data: {},
  start: function (key) {
    Timer.data[key] = new Date();
    console.log( Timer.data[key].format('yyyy-MM-dd HH:mm:ss'));
  },
  stop: function (key) {
    let time = Timer.data[key];
    if (time) Timer.data[key] = new Date() - time;
  },
  getTime: function (key) {
    return Timer.data[key];
  },
  getFormatTime: function (key) {
    return parseInt(Timer.data[key])/1000;
  },
};

// Timer.start('hh')
const start =  moment();
console.log(start.format('YYYY-MM-DD HH:mm:ss'));
for(let i=0;i<10000000;i++){}
const end =  moment();
// console.log(end-start);

